<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ page import="model.Employee" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%
// メンバー一覧表示用のテーブル
String tableHTML = "<table border>";
Employee employee = (Employee) request.getAttribute("employee");
String employee_no = employee.employee_no; // 社員番号を取得
String first_name = employee.first_name; // 社員苗字を取得
String last_name = employee.last_name; // 社員名前を取得
String sex = employee.sex; // 性別を取得
String join_date = employee.join_date; // 性別を取得
String section = employee.section; // 性別を取得
String mail = employee.mail; // 性別を取得
    // 性別のデフォルト値判定
    String sex_html = "";
    String section_html = "";
    if(sex.equals("1")){
    	sex_html = "<tr><th>性別</th><td colspan=2>男性<input type=\"radio\" name=\"sex\" size=\"40\" maxlength=\"2\" value=\"1\" checked>　女性<input type=\"radio\" name=\"sex\" size=\"40\" maxlength=\"2\" value=\"2\"></td></tr>\n";
    }
    if(sex.equals("2")){
    	sex_html = "<tr><th>性別</th><td colspan=2>男性<input type=\"radio\" name=\"sex\" size=\"40\" maxlength=\"2\" value=\"1\">　女性<input type=\"radio\" name=\"sex\" size=\"40\" maxlength=\"2\" value=\"2\" checked></td></tr>\n";
    }
    // 部門のデフォルト値判定
    if(section.equals("BS1")){
    	section_html = "<tr><th>部門※</th><td><SELECT name=\"section\"><OPTION value=\"BS1\" selected>BS1</OPTION><OPTION value=\"BS2\">BS2</OPTION><OPTION value=\"BS3\">BS3</OPTION><OPTION value=\"BS4\">BS4</OPTION><OPTION value=\"ES1\">ES1</OPTION><OPTION value=\"ES2\">ES2</OPTION><OPTION value=\"ES3\">ES3</OPTION><OPTION value=\"ES4\">ES4</OPTION><OPTION value=\"SS1\">SS1</OPTION><OPTION value=\"SS2\">SS2</OPTION><OPTION value=\"SS3\">SS3</OPTION><OPTION value=\"SS4\">SS4</OPTION></SELECT></td></tr>";
    }
    if(section.equals("BS2")){
    	section_html = "<tr><th>部門※</th><td><SELECT name=\"section\"><OPTION value=\"BS1\">BS1</OPTION><OPTION value=\"BS2\" selected>BS2</OPTION><OPTION value=\"BS3\">BS3</OPTION><OPTION value=\"BS4\">BS4</OPTION><OPTION value=\"ES1\">ES1</OPTION><OPTION value=\"ES2\">ES2</OPTION><OPTION value=\"ES3\">ES3</OPTION><OPTION value=\"ES4\">ES4</OPTION><OPTION value=\"SS1\">SS1</OPTION><OPTION value=\"SS2\">SS2</OPTION><OPTION value=\"SS3\">SS3</OPTION><OPTION value=\"SS4\">SS4</OPTION></SELECT></td></tr>";
    }
    if(section.equals("BS3")){
    	section_html = "<tr><th>部門※</th><td><SELECT name=\"section\"><OPTION value=\"BS1\">BS1</OPTION><OPTION value=\"BS2\">BS2</OPTION><OPTION value=\"BS3\" selected>BS3</OPTION><OPTION value=\"BS4\">BS4</OPTION><OPTION value=\"ES1\">ES1</OPTION><OPTION value=\"ES2\">ES2</OPTION><OPTION value=\"ES3\">ES3</OPTION><OPTION value=\"ES4\">ES4</OPTION><OPTION value=\"SS1\">SS1</OPTION><OPTION value=\"SS2\">SS2</OPTION><OPTION value=\"SS3\">SS3</OPTION><OPTION value=\"SS4\">SS4</OPTION></SELECT></td></tr>";
    }
    if(section.equals("BS4")){
    	section_html = "<tr><th>部門※</th><td><SELECT name=\"section\"><OPTION value=\"BS1\">BS1</OPTION><OPTION value=\"BS2\">BS2</OPTION><OPTION value=\"BS3\">BS3</OPTION><OPTION value=\"BS4\" selected>BS4</OPTION><OPTION value=\"ES1\">ES1</OPTION><OPTION value=\"ES2\">ES2</OPTION><OPTION value=\"ES3\">ES3</OPTION><OPTION value=\"ES4\">ES4</OPTION><OPTION value=\"SS1\">SS1</OPTION><OPTION value=\"SS2\">SS2</OPTION><OPTION value=\"SS3\">SS3</OPTION><OPTION value=\"SS4\">SS4</OPTION></SELECT></td></tr>";
    }
    if(section.equals("ES1")){
    	section_html = "<tr><th>部門※</th><td><SELECT name=\"section\"><OPTION value=\"BS1\">BS1</OPTION><OPTION value=\"BS2\">BS2</OPTION><OPTION value=\"BS3\">BS3</OPTION><OPTION value=\"BS4\">BS4</OPTION><OPTION value=\"ES1\" selected>ES1</OPTION><OPTION value=\"ES2\">ES2</OPTION><OPTION value=\"ES3\">ES3</OPTION><OPTION value=\"ES4\">ES4</OPTION><OPTION value=\"SS1\">SS1</OPTION><OPTION value=\"SS2\">SS2</OPTION><OPTION value=\"SS3\">SS3</OPTION><OPTION value=\"SS4\">SS4</OPTION></SELECT></td></tr>";
    }
    if(section.equals("ES2")){
    	section_html = "<tr><th>部門※</th><td><SELECT name=\"section\"><OPTION value=\"BS1\">BS1</OPTION><OPTION value=\"BS2\">BS2</OPTION><OPTION value=\"BS3\">BS3</OPTION><OPTION value=\"BS4\">BS4</OPTION><OPTION value=\"ES1\">ES1</OPTION><OPTION value=\"ES2\" selected>ES2</OPTION><OPTION value=\"ES3\">ES3</OPTION><OPTION value=\"ES4\">ES4</OPTION><OPTION value=\"SS1\">SS1</OPTION><OPTION value=\"SS2\">SS2</OPTION><OPTION value=\"SS3\">SS3</OPTION><OPTION value=\"SS4\">SS4</OPTION></SELECT></td></tr>";
    }
    if(section.equals("ES3")){
    	section_html = "<tr><th>部門※</th><td><SELECT name=\"section\"><OPTION value=\"BS1\">BS1</OPTION><OPTION value=\"BS2\">BS2</OPTION><OPTION value=\"BS3\">BS3</OPTION><OPTION value=\"BS4\">BS4</OPTION><OPTION value=\"ES1\">ES1</OPTION><OPTION value=\"ES2\">ES2</OPTION><OPTION value=\"ES3\" selected>ES3</OPTION><OPTION value=\"ES4\">ES4</OPTION><OPTION value=\"SS1\">SS1</OPTION><OPTION value=\"SS2\">SS2</OPTION><OPTION value=\"SS3\">SS3</OPTION><OPTION value=\"SS4\">SS4</OPTION></SELECT></td></tr>";
    }
    if(section.equals("ES4")){
    	section_html = "<tr><th>部門※</th><td><SELECT name=\"section\"><OPTION value=\"BS1\">BS1</OPTION><OPTION value=\"BS2\">BS2</OPTION><OPTION value=\"BS3\">BS3</OPTION><OPTION value=\"BS4\">BS4</OPTION><OPTION value=\"ES1\">ES1</OPTION><OPTION value=\"ES2\">ES2</OPTION><OPTION value=\"ES3\">ES3</OPTION><OPTION value=\"ES4\" selected>ES4</OPTION><OPTION value=\"SS1\">SS1</OPTION><OPTION value=\"SS2\">SS2</OPTION><OPTION value=\"SS3\">SS3</OPTION><OPTION value=\"SS4\">SS4</OPTION></SELECT></td></tr>";
    }
    if(section.equals("SS1")){
    	section_html = "<tr><th>部門※</th><td><SELECT name=\"section\"><OPTION value=\"BS1\">BS1</OPTION><OPTION value=\"BS2\">BS2</OPTION><OPTION value=\"BS3\">BS3</OPTION><OPTION value=\"BS4\">BS4</OPTION><OPTION value=\"ES1\">ES1</OPTION><OPTION value=\"ES2\">ES2</OPTION><OPTION value=\"ES3\">ES3</OPTION><OPTION value=\"ES4\">ES4</OPTION><OPTION value=\"SS1\" selected>SS1</OPTION><OPTION value=\"SS2\">SS2</OPTION><OPTION value=\"SS3\">SS3</OPTION><OPTION value=\"SS4\">SS4</OPTION></SELECT></td></tr>";
    }
    if(section.equals("SS2")){
    	section_html = "<tr><th>部門※</th><td><SELECT name=\"section\"><OPTION value=\"BS1\">BS1</OPTION><OPTION value=\"BS2\">BS2</OPTION><OPTION value=\"BS3\">BS3</OPTION><OPTION value=\"BS4\">BS4</OPTION><OPTION value=\"ES1\">ES1</OPTION><OPTION value=\"ES2\">ES2</OPTION><OPTION value=\"ES3\">ES3</OPTION><OPTION value=\"ES4\">ES4</OPTION><OPTION value=\"SS1\">SS1</OPTION><OPTION value=\"SS2\" selected>SS2</OPTION><OPTION value=\"SS3\">SS3</OPTION><OPTION value=\"SS4\">SS4</OPTION></SELECT></td></tr>";
    }
    if(section.equals("SS3")){
    	section_html = "<tr><th>部門※</th><td><SELECT name=\"section\"><OPTION value=\"BS1\">BS1</OPTION><OPTION value=\"BS2\">BS2</OPTION><OPTION value=\"BS3\">BS3</OPTION><OPTION value=\"BS4\">BS4</OPTION><OPTION value=\"ES1\">ES1</OPTION><OPTION value=\"ES2\">ES2</OPTION><OPTION value=\"ES3\">ES3</OPTION><OPTION value=\"ES4\">ES4</OPTION><OPTION value=\"SS1\">SS1</OPTION><OPTION value=\"SS2\">SS2</OPTION><OPTION value=\"SS3\" selected>SS3</OPTION><OPTION value=\"SS4\">SS4</OPTION></SELECT></td></tr>";
    }
    if(section.equals("SS4")){
    	section_html = "<tr><th>部門※</th><td><SELECT name=\"section\"><OPTION value=\"BS1\">BS1</OPTION><OPTION value=\"BS2\">BS2</OPTION><OPTION value=\"BS3\">BS3</OPTION><OPTION value=\"BS4\">BS4</OPTION><OPTION value=\"ES1\">ES1</OPTION><OPTION value=\"ES2\">ES2</OPTION><OPTION value=\"ES3\">ES3</OPTION><OPTION value=\"ES4\">ES4</OPTION><OPTION value=\"SS1\">SS1</OPTION><OPTION value=\"SS2\">SS2</OPTION><OPTION value=\"SS3\">SS3</OPTION><OPTION value=\"SS4\" selected>SS4</OPTION></SELECT></td></tr>";
    }
    tableHTML += "<tr><th>社員番号</th><td colspan=2><input type=\"text\" readonly name=\"employee_no\" size=\"40\" maxlength=\"5\" value=\"" + employee_no + "\"</td></tr>\n"
              + "<tr><th>名前（姓・名）</th><td>" + "姓　" + "<input type=\"text\"  name=\"first_name\" size=\"13\" maxlength=\"15\" value=\"" + first_name + "\"</td><td>"
    		  + "\n名　" + "<input type=\"text\" name=\"last_name\" size=\"13\" maxlength=\"15\" value=\"" + last_name + "\"</td></tr>\n"
              + sex_html
              + "<tr><th>入社年月日</th><td colspan=2><input type=\"text\" name=\"join_date\" size=\"40\" maxlength=\"8\" value=\"" + join_date + "\"</td></tr>\n"
              + section_html
              + "<tr><th>メールアドレス</th><td colspan=2><input type=\"text\" name=\"mail\" size=\"40\" maxlength=\"256\" value=\"" + mail + "\"</td></tr>\n";
tableHTML += "</table>";
%>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
<head>
<!-- meta -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="content-style-type" content="text/css" />
<meta http-equiv="content-script-type" content="text/javascript" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<!-- css -->
<link href="style.css" media="all" rel="stylesheet" type="text/css" />
<!-- js -->
<script src="" type="text/javascript"></script>
<!-- title -->
<title>NEMS</title>
</head>
<body>
<h1>NEMS 【NJK Employee Management System】</h1>
<a href="/NEMS/Menu">メニューへ戻る</a><div align="right"><a href="/NEMS/Login">ログアウト</a></div>
<h2>社員情報更新　入力</h2>
<form method="post" action="/NEMS/UpdateConfirmation" Accept-charset="UTF-8">
<%= tableHTML %>
<input type="submit" name="back" value="戻る" onClick="history.back(); return false;">　<input type="submit" name="update_confirmation" value="確認画面へ">
</form>
</body>
</html>